package com.luban.producer.controller;

import com.luban.producer.service.TestService;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 需要视频资料或咨询课程的同学可以添加若曦老师的QQ:2746251334
 */
@RestController
public class TestController {


    @Autowired
    RocketMQTemplate template;
    @Autowired
    TestService testService;

    @RequestMapping("/test.do")
    public Object test() {

        template.convertAndSend("test", "测试消息");

        return "操作成功";
    }


    @RequestMapping("/insert.do")
    public Object insert(@RequestParam Map<String,Object> map) {

        testService.sendTransactionMessage(map);

        return "操作成功";
    }


}
